<?php

$timeConnect	= $info->get( 'connect_time' ) + $info->get( 'redirect_time' );
$timePrepare	= $info->get( 'pretransfer_time' ) - $info->get( 'connect_time' );
$timeWork		= $info->get( 'starttransfer_time' ) - $info->get( 'pretransfer_time' );
$timeTransfer	= $info->get( 'total_time' ) - $info->get( 'starttransfer_time' ) - $info->get( 'redirect_time' );
$timeT	= $info->get( 'total_time' );
/*$list	= array();
foreach( $info as $key => $value )
	if( !is_array( $value ) )
		$list[]	= UI_HTML_Tag::create( 'dt', $key ).UI_HTML_Tag::create( 'dd', $value );
$list	= UI_HTML_Tag::create( 'dl', $list );*/
return '

	<hr/>
	<div class="row-fluid">
		<div class="span12">
			<h3>Transfer</h3>
			<dl>
				<dt>HTTP Status</dt><dd><big>'.$info->get( 'http_code' ).' '.Net_HTTP_Status::getText( $info->get( 'http_code' ) ).'</big></dd>
				<dt>Downloaded</dt><dd><big>'.Alg_UnitFormater::formatBytes( $info->get( 'size_download' ) ).'</big> <small class="muted">('.Alg_UnitFormater::formatBytes( $info->get( 'speed_download' ) ).'/s)</small></dd>
				<dt>Server Time</dt><dd><big>'.Alg_UnitFormater::formatSeconds( $info->get( 'starttransfer_time' ) - $info->get( 'pretransfer_time' ) ).'</big> <small class="muted">('.Alg_UnitFormater::formatSeconds( $info->get( 'total_time' ) ).')</small></dd>
				<dt>Content Type</dt><dd><big>'.$info->get( 'content_type' ).'</big></dd>
			</dl>
		</div>
	</div>
	<small>
		<hr/>
		<div class="row-fluid">
			<div class="span12">
				<h4>Address <small class="muted">(& Redirect)</small></h4>
				<dl>
					<dt>Client IP</dt>
					<dd>'.$info->get( 'local_ip' ).'</dd>
					<dt>Request IP</dt>
					<dd>'.$info->get( 'primary_ip' ).'</dd>
					<dt>Rquest URL</dt>
					<dd>'.$info->get( 'url' ).'</dd>
					<dt>Redirect URL</dt>
					<dd>'.$info->get( 'redirect_url' ).'</dd>
					<dt>Redirects</dt>
					<dd>'.$info->get( 'redirect_count' ).' in '.Alg_UnitFormater::formatMilliseconds( $info->get( 'redirect_time' ) * 1000 ).'</dd>
				</dl>
			</div>
		</div>
		<hr/>
		<div class="progress">
			<div class="bar bar-warning" style="width: '.round( $timeConnect / $timeT * 100, 8 ).'%;">Connect / Redirect</div>
			<div class="bar bar-info" style="width: '.round( $timePrepare / $timeT * 100, 8 ).'%;">Prepare</div>
			<div class="bar bar" style="width: '.round( $timeWork / $timeT * 100, 8 ).'%;">Work</div>
			<div class="bar bar-success" style="width: '.round( $timeTransfer / $timeT * 100, 8 ).'%;">Transfer</div>
		</div>
		<div class="row-fluid">
			<div class="span4">
				<h4>Times</h4>
				<dl>
					<dt>DNS Lookup</dt>
					<dd>'.Alg_UnitFormater::formatMilliseconds( $info->get( 'namelookup_time' ) * 1000 ).'</dd>
					<dt>Connect / Redirect</dt>
					<dd>'.Alg_UnitFormater::formatMilliseconds( ( $info->get( 'connect_time' ) + $info->get( 'redirect_time' ) ) * 1000 ).'</dd>
					<dt>Pretransfer</dt>
					<dd>'.Alg_UnitFormater::formatMilliseconds( $info->get( 'pretransfer_time' ) * 1000 ).'</dd>
					<dt>Start Transfer</dt>
					<dd>'.Alg_UnitFormater::formatMilliseconds( $info->get( 'starttransfer_time' ) * 1000 ).'</dd>
					<dt>Total</dt>
					<dd>'.Alg_UnitFormater::formatMilliseconds( ( $info->get( 'total_time' ) - $info->get( 'redirect_time' ) ) * 1000 ).'</dd>
				</dl>
			</div>
			<div class="span4">
				<h4>Size</h4>
				<dl>
					<dt>Size: Request</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'request_size' ) ).'</dd>
					<dt>Size: Header</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'header_size' ) ).'</dd>
					<dt>Size: Upload</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'size_upload' ) ).'</dd>
					<dt>Size: Download</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'size_download' ) ).'</dd>
				</dl>
			</div>
			<div class="span4">
				<h4>Speed</h4>
				<dl>
					<dt>Speed: Upload</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'speed_upload' ) ).'/s</dd>
					<dt>Speed: Download</dt>
					<dd>'.Alg_UnitFormater::formatBytes( $info->get( 'speed_download' ) ).'/s</dd>
				</dl>
			</div>
		</div>
	</small>';
?>
